package com.ruoyi.report.forms.service.impl;

import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.report.forms.mapper.DispatchChangeShiftsMapper;
import com.ruoyi.report.forms.domain.DispatchChangeShifts;
import com.ruoyi.report.forms.service.IDispatchChangeShiftsService;

/**
 * 调度交接班管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-14
 */
@Service
public class DispatchChangeShiftsServiceImpl implements IDispatchChangeShiftsService 
{
    @Autowired
    private DispatchChangeShiftsMapper dispatchChangeShiftsMapper;

    /**
     * 查询调度交接班管理
     * 
     * @param id 调度交接班管理主键
     * @return 调度交接班管理
     */
    @Override
    public DispatchChangeShifts selectDispatchChangeShiftsById(String id)
    {
        return dispatchChangeShiftsMapper.selectDispatchChangeShiftsById(id);
    }

    /**
     * 查询调度交接班管理列表
     * 
     * @param dispatchChangeShifts 调度交接班管理
     * @return 调度交接班管理
     */
    @Override
    public List<DispatchChangeShifts> selectDispatchChangeShiftsList(DispatchChangeShifts dispatchChangeShifts)
    {
        return dispatchChangeShiftsMapper.selectDispatchChangeShiftsList(dispatchChangeShifts);
    }

    /**
     * 新增调度交接班管理
     * 
     * @param dispatchChangeShifts 调度交接班管理
     * @return 结果
     */
    @Override
    public int insertDispatchChangeShifts(DispatchChangeShifts dispatchChangeShifts)
    {
        if(StringUtils.isBlank(dispatchChangeShifts.getId())){
        /*dispatchChangeShifts.setId(IdUtils.fastSimpleUUID());*/
        }
        dispatchChangeShifts.setCreateTime(DateUtils.getNowDate());
        return dispatchChangeShiftsMapper.insertDispatchChangeShifts(dispatchChangeShifts);
    }

    /**
     * 修改调度交接班管理
     * 
     * @param dispatchChangeShifts 调度交接班管理
     * @return 结果
     */
    @Override
    public int updateDispatchChangeShifts(DispatchChangeShifts dispatchChangeShifts)
    {
        dispatchChangeShifts.setUpdateTime(DateUtils.getNowDate());
        return dispatchChangeShiftsMapper.updateDispatchChangeShifts(dispatchChangeShifts);
    }

    /**
     * 批量删除调度交接班管理
     * 
     * @param ids 需要删除的调度交接班管理主键
     * @return 结果
     */
    @Override
    public int deleteDispatchChangeShiftsByIds(String[] ids)
    {
        return dispatchChangeShiftsMapper.deleteDispatchChangeShiftsByIds(ids);
    }

    /**
     * 删除调度交接班管理信息
     * 
     * @param id 调度交接班管理主键
     * @return 结果
     */
    @Override
    public int deleteDispatchChangeShiftsById(String id)
    {
        return dispatchChangeShiftsMapper.deleteDispatchChangeShiftsById(id);
    }
}
